Conversation
+ Using 2 functions that makes able to faster processing; + Using Math.abs for input value for being sure input number is positive (previous version was just stopping program execution by assert); + Assert now just checking input value is not zero; - Current version using much more memory then previous;
|
|
||
| public class Main { | ||
|
|
||
| public static void main(String[] args) { |
There was a problem hiding this comment.
Well done! The game interface looks pretty nice, even though it lacks row delimiters. Playing is comfortable, it shows pretty informative messages. Also, a lot of features are introduced, as well as exit code and description. You show good knowledge of Java Core and Java libraries, abstractions are mostly well-picked, architecture is good, but it can be improved. Also, you have lots of static, and it's not recommended.
Approved!
There was a problem hiding this comment.
I understood you. Thanks for the review!
|
|
||
| public void run() { | ||
| DialogueMenu.printGreetings(); | ||
| DialogueMenu.printMainMenu(); |
There was a problem hiding this comment.
The method name doesn't correlate with what it does
There was a problem hiding this comment.
Fully agree, but i couldn't find better for this.
Before the game process started it's fully controlled by the menu - so User picks whatever wants, that's why it's like an entrance point into the game at this moment.
|
|
||
| public final class ImmutableClass { | ||
|
|
||
| private final String name; // reference type |
There was a problem hiding this comment.
I know it's unclear in description, but I meant field which it mutable...
| import static homework_4.custom_file_reader.utils.ModifiedStringPrinter.printModifiedString; | ||
|
|
||
|
|
||
| public class CustomFileReader { |
| */ | ||
|
|
||
|
|
||
| public class Main { |
There was a problem hiding this comment.
Quite nice approach to HW_4! Looks good
|
|
||
| private CustomRegexMatcher() { } | ||
|
|
||
| private static final String PHONE_NUMBER_FORMAT = "(\\+\\d)\\s\\(\\d{3}\\)\\s(\\d{3})-(\\d{4})"; |
There was a problem hiding this comment.
Opt: You could add some variability to regex (like, accept phone numbers with different country codes and etc)
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return new Random().nextInt(Integer.MAX_VALUE - 1); |
There was a problem hiding this comment.
Well, there;s no mutable key problem, it's just invalid hashcode implementation. Mutable key generates problem even if hashcode impl is valid
There was a problem hiding this comment.
He fixed hashCode() and seems like mutable problem is appeared!
| private final int age; | ||
| private final String name; |
There was a problem hiding this comment.
Opt: you could provide such fields and such lambda, that it'll make type conversion
NikolaevArtem
left a comment
There was a problem hiding this comment.
Well-done! You introduce new approaches to tasks, experiment with Java Core, which is cool. There are minor issues to fix, but in general, your HW looks really good! And special thanks for all code review efforts you did
| @@ -48,7 +49,7 @@ public List<Number> getAllDataList() { | |||
| return new LinkedList<>(this.allDataList); | |||
There was a problem hiding this comment.
Good approach! Approved!


No description provided.